list_o = [[[-35.375, -34.825], [-4, -3]], [[-3.275, -2.725], [-4, -3]], [[20.725, 21.275], [-4, -3]], \
        [[57.725, 58.275], [-4, -3]], [[83.725, 84.275], [-4, -3]], [[-25.475, -24.925], [3, 4]], [[8.725, 9.275], [3, 4]], \
        [[26.725, 27.275], [3, 4]], [[70.725, 71.275], [3, 4]], [[90.225, 90.775], [3, 4]],[[53.2, 54.2],[-9.0, -6.72]], \
        [[79, 92], [-33.6, -28]],[[3, 9], [34, 36]], [[-35.0, -20.0], [17.0, 33.5]], [[4.0, 22.0], [11.0, 25.0]], [[55, 69.0], [15, 30.3]], \
        [[71.5, 83.5], [9.2, 18.5]], [[88.3, 100.7], [11.9, 16.2]], [[79, 94.7], [22.2, 34.5]], [[53, 70], [-35, -27]], [[-5.4, 7.0], [-19.4, -10.0]], \
        [[18.5, 39.5], [-22.5, -5.5]], [[-5.0, 5.0], [-34.0, -22.0]], [[-27.8, -23.5], [-27.5, -15]], [[-36, -24], [-35, -31]], \
        [[-35.5, -31.3], [-25.5, -13]], [[3.0,8.2],[34.3,35.7]]]

def change_list(list_o, d):
    list_result = []
    k = 1.0*d/2.0
    count = 0
    for item in list_o:
        count += 1
        y = item[1][0] + k
        while (y+k) <= item[1][1]:
            x = item[0][0]+k
            if count == 1:
                print(y)
            #list_result.append([round(xx, 4),round(yy, 4)])
            list_result.append([x, y])
            while (x+k) <= item[0][1]:
                x += d
                #list_result.append([round(x, 4),round(yy, 4)])
                list_result.append([x, y])
            y += d
    return list_result

# print change_list([[[15, 18], [-16, -12]]], 2)
result_list = change_list(list_o, 1.0)
length = len(result_list)

ARRS = []

f=open('obstacle.txt','w+')

for i in range(length):

    jointsFrame = result_list[i]

    ARRS.append(jointsFrame)

    for Ji in range(2):

        strNum = str(jointsFrame[Ji])

        f.write(strNum)

        f.write(' ')

    f.write('\n')

f.close()

